<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <center>
        <h1>商品展示</h1>
        <table border="1">
            <tr>
                <th>编号</th>
                <th>商品名称</th>
                <th>商品图片</th>
                <th>商品描述</th>
                <th>库存</th>
                <th>操作</th>
            </tr>
            <tr>
                <td>1</td>
                <td>天安门</td>
                <td><img src="" alt=""></td>
                <td>好玩</td>
                <td>10</td>
                <td><a href="">修改</a><a href="">删除</a></td>
            </tr>
        </table>
    </center>
</body>
<script src="../js/jquery-3.4.1 .js"></script>
<script>
$.get("./server/goodslist.php",function(res){
    var str = '';
    var html = $("table").html()
    for(var i=0;i<res.length;i++){
        str += `
            <tr>
                <td>${res[i].id}</td>
                <td>${res[i].name}</td>
                <td><img src="${res[i].imgpath}width="50"" height="50"></td>
                <td>${res[i].stock}</td>
                <td><a href="">修改</a><a href="">删除</a></td>

        `
    }
    缺一个
},"json")
</script>
</html>